<template>
	<view class="content">
		<c-progress-circle :progress='progress' :color='color' :size='size' :boderWidth="boderWidth"></c-progress-circle>
		<view class="btnBox">
			<button size="mini" @click="add">+</button>
			<view style="width: 100rpx;text-align: center;">
				{{progress}}
			</view>
			<button size="mini" @click="reduce" type="default">-</button>
		</view>
		<view class="btnBox" style="padding-left: 100rpx;">边框颜色</view>
		<view class="btnBox">
			<button size="mini" @click="color='red'">红色</button>
			<button size="mini" @click="color='green'">绿色</button>
			<button size="mini" @click="color='orange'">橙色</button>
		</view>
		<view class="btnBox" style="padding-left: 100rpx;">进度条尺寸</view>
		<view class="btnBox">
			<button size="mini" @click="size='200rpx'">200rpx</button>
			<button size="mini" @click="size='400rpx'">400rpx</button>
			<button size="mini" @click="size='600rpx'">600rpx</button>
		</view>
		<view class="btnBox" style="padding-left: 100rpx;">边框宽度</view>
		<view class="btnBox">
			<button  size="mini" @click="boderWidth='200rpx'">200rpx</button>
			<button  size="mini" @click="boderWidth='400rpx'">400rpx</button>
			<button  size="mini" @click="boderWidth='600rpx'">600rpx</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				progress: 0.2,
				color:'red',
				size:'200rpx',
				boderWidth:'200rpx'
			}
		},
		methods: {
			add() {
				if(this.progress<1){
					this.progress +=0.1
					this.progress=this.progress.toFixed(1)*1
				}
			},
			reduce(){
				if(this.progress>0){
					this.progress -=0.1
					this.progress=this.progress.toFixed(1)*1	
				}
			}
		},
	}
</script>

<style lang="scss">
	.content{
		display: flex;
		flex-direction: column;
		align-items: center;
		padding-top: 20rpx;
		font-size: 28rpx;
	}
	.btnBox{
		width: 100%;
		display: flex;
		align-items: center;
		margin-top:30rpx;
	}
</style>
